//
//  AccurateModel.m
//  HimalayaMusic
//
//  Created by dllo on 16/1/13.
//  Copyright © 2016年 WXCLegendary. All rights reserved.
//

#import "AccurateModel.h"

@implementation AccurateModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"album"]) {
        NSDictionary *dictionary = value;
        self.album_numFound = dictionary[@"numFound"];
        self.albumArray = [NSMutableArray array];
        for (NSDictionary *dic in dictionary[@"docs"]) {
            AlbuModel *albuModel = [[AlbuModel alloc] initWithDicyionary:dic];
            [self.albumArray addObject:albuModel];
        }
    }
    if ([key isEqualToString:@"user"]) {
        NSDictionary *dictionary = value;
        self.user_numFound = dictionary[@"numFound"];
        self.userArray = [NSMutableArray array];
        for (NSDictionary *dic in dictionary[@"docs"]) {
            UserModel *userModel = [[UserModel alloc] initWithDictionary:dic];
            
            
            [self.userArray addObject:userModel];
        }
        
    }
    if ([key isEqualToString:@"track"]) {
        NSDictionary *dictionary = value;
        self.track_numFound = dictionary[@"numFound"];
        self.trackArray = [NSMutableArray array];
        for (NSDictionary *dic in dictionary[@"docs"]) {
            TrackModel *trackModel = [[TrackModel alloc] initWithDictionary:dic];
            [self.trackArray addObject:trackModel];
        }
    }
    
    
    
    
    
    
    
    
}

- (instancetype)initWithDictionary:(NSDictionary *)data
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:data];
    }
    return self;
}










@end
